from django.urls import re_path

from rest_framework.urlpatterns import format_suffix_patterns

from app.apps import CurrentAppConfig

from .views import *


app_name = CurrentAppConfig.name


urlpatterns = format_suffix_patterns([
    # 用户地址列表和创建
    re_path(r'^address/$', UserAddressListCreateView.as_view(), name='user_addresses'),
    # 用户地址获取和更新
    re_path(r'^address/(?P<pk>[0-9]+)/$', UserAddressRetrieveUpdateAPIView.as_view(), name='user_address'),
    # 用户的 VIP 信息
    re_path(r'^vip_info/$', VipInfoView.as_view(), name='vip_info'),
    # 用户信息
    re_path(r'^user_info/$', UserInfoView.as_view(), name='user_info'),
])
